home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / answers / unix-faq / shell / zsh < prev   
Encoding:
Internet Message Format  |  1993-06-23  |  30.7 KB

  1. Path: senator-bedfellow.mit.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!mcsun!uknet!liv!amtp!pws
  2. From: pws@s-a.amtp.liv.ac.uk (Peter Stephenson)
  3. Newsgroups: comp.unix.shell,comp.answers,news.answers
  4. Subject: Z-shell Frequently-Asked Questions
  5. Summary: Q's and A's about zsh, a powerful (and free) UNIX shell
  6. Message-ID: <PWS.93Jun23171304@suna.amtp.liv.ac.uk>
  7. Date: 23 Jun 93 16:13:04 GMT
  8. Expires: Sat, 24 Jul 1993 00:00:00 GMT
  9. Sender: news@liverpool.ac.uk (News System)
  10. Reply-To: Peter Stephenson <pws@s-a.amtp.liv.ac.uk>
  11. Followup-To: comp.unix.shell
  12. Organization: DAMTP, University of Liverpool
  13. Lines: 666
  14. Approved: news-answers-request@MIT.Edu
  15. Supersedes: <PWS.93May23200824@suna.s-a.amtp.liv.ac.uk>
  16. Nntp-Posting-Host: suna.amtp.liv.ac.uk
  17. Xref: senator-bedfellow.mit.edu comp.unix.shell:10887 comp.answers:1113 news.answers:9700
  18.  
  19. Archive-Name: unix-faq/shell/zsh
  20. Last-Modified: 1993/06/23
  21. Submitted-By: pws@s-a.amtp.liv.ac.uk (Peter Stephenson)
  22. Version: $Id: zsh.FAQ,v 1.11 1993/06/22 13:46:18 pws Exp pws $
  23. Frequency: Monthly
  24.  
  25. This document contains a list of frequently-asked (or otherwise
  26. significant) questions concerning the Z-shell, a command interpreter for
  27. many UNIX systems which is freely available to anyone with FTP access.
  28. Zsh is more powerful than every other common shell (sh, ksh, csh, tcsh
  29. and bash) put together.
  30.  
  31. If you have never heard of `sh', `csh' or `ksh', then you are probably
  32. better off to start by reading a general introduction to UNIX rather
  33. than this document.
  34.  
  35. Another useful source of information is the collection of FAQ articles
  36. posted frequently to the Usenet news groups comp.unix.questions,
  37. comp.unix.shells and comp.answers with answers to general questions
  38. about UNIX.  The fifth of the seven articles deals with shells,
  39. including zsh, with a brief description of differences.  (This article
  40. also talks about shell startup files which would otherwise rate a
  41. mention here.)
  42.  
  43. If you just want to know how to get your hands on the latest version,
  44. skip to question 4; if you want to know what to do with insoluble
  45. problems, go to 20.
  46.  
  47. To encourage you to read on, if you don't know about zsh but are
  48. familiar with other UNIX shells, here are some things that zsh is
  49. particularly good at.  No claim of exclusivity is made, especially as
  50. shells copy one another, though in the areas of command line editing and
  51. globbing zsh is well ahead of the competition.  I am not aware of a
  52. major feature in any other freely-available shell which zsh does not
  53. also have.
  54.   Command line editing:
  55.     programmable completion: incorporates the ability to use
  56.       the full power of zsh globbing (compctl -g),
  57.     multi-line commands editable as a single buffer (even files!),
  58.     variable editing (vared),
  59.     command buffer stack,
  60.     print text straight into the buffer for immediate editing (print -z),
  61.     execution of unbound commands,
  62.     menu completion,
  63.     variable, editing function and option name completion,
  64.     inline expansion of variables, history commands.
  65.   Globbing --- extremely powerful, including:
  66.     recursive globbing (cf. find),
  67.     file attribute qualifiers (size, type, etc. also cf. find),
  68.     full alternation and negation of patterns.
  69.   Handling of multiple redirections (simpler than tee).
  70.   Large number of options for tailoring.
  71.   Path expansion (=foo -> /usr/bin/foo).
  72.   Adaptable messages for spelling, watch, time as well as prompt
  73.     (now including conditional expressions).
  74.   Named directories.
  75.   Comprehensive integer arithmetic.
  76.   Manipulation of arrays (including reverse subscripting).
  77.   Spelling correction (which works).
  78.  
  79.  
  80. Notation: Quotes `like this' are ordinary textual quotation
  81. marks.  Other uses of quotation marks are input to the shell.
  82.  
  83. Contents:
  84. 1) What is it?
  85. 2) On what machines will it run?
  86. 3) What's the latest version?
  87. 4) Where do I get it?
  88. 5) How does zsh differ from sh, ksh, csh,...?
  89. 6) Why do my csh aliases not work?  (Plus other alias pitfalls.)
  90. 7) How do I get the meta key to work on my xterm?
  91. 8) Why does my terminal act funny in way x?
  92. 9) Why does `$var' where var="foo bar" not do what I expect?
  93. 10) My PATH, (MANPATH, ...) sometimes doesn't handle tildes.  What gives?
  94. 11) How does base arithmetic work?
  95. 12) How do I get a newline in my prompt?
  96. 13) Why does `bindkey ^a command-name' or 'stty intr ^-' do something funny?
  97. 14) How do I execute command `foo' within function `foo'?
  98. 15) Why can't I get zsh to work with SGI's `userenv'?
  99. 16) Why do history substitutions with single bangs do something funny?
  100. 17) Why does zsh kill off all my background jobs when I logout?
  101. 18) I don't have root access: how do I make zsh my login shell?
  102. 19) What bugs are currently known and unfixed?
  103. 20) Where do I report bugs, get more info / who's working on zsh?
  104. 21) What's on the wish-list?
  105. --- End of Contents ---
  106.  
  107.  
  108. 1) What is it?
  109.  
  110.   Zsh is a UNIX command interpreter (shell) which of the standard shells
  111.   most resembles the Korn shell (ksh), although it is not completely
  112.   compatible.  It includes enhancements of many types, notably in the
  113.   command-line editor, options for customising its behaviour, filename
  114.   globbing, features to make C-shell (csh) users feel more at home and
  115.   extra features drawn from tcsh (another `custom' shell).
  116.  
  117.   It was written by Paul Falstad <pf@z-code.com> when a student at
  118.   Princeton; however, Paul doesn't maintain it any more and enquiries
  119.   should be sent to the mailing list (see question 20).  It is freely
  120.   available to anyone under unrestrictive conditions.
  121.  
  122.   For more information, the files doc/intro.txt or doc/intro.troff
  123.   included with the source distribution are highly recommended.  A list
  124.   of features is given in FEATURES, also with the source.
  125.  
  126.  
  127. 2) On what machines will it run?
  128.  
  129.   Zsh was written for machines of the Berkeley UNIX family; most such
  130.   machines (and all the most popular) will run it without major surgery.
  131.   Modifications have been made so that it should work under SYSVR4-based
  132.   operating systems such as Solaris 2.x and OSF/1.  This best thing is
  133.   to suck it and see.  You may not have to change too much: if you do
  134.   change anything, arrange for the shell script `buildzsh' to set the
  135.   necessary #define's, etc., without human intervention.  Recent
  136.   additions include Convex, Unicos and Linux support; there is a project
  137.   to allow POSIX.1 compilation (but note that that zsh is not itself
  138.   particularly POSIX-compliant at the moment).
  139.  
  140.  
  141. 3) What's the latest version?
  142.   
  143.   The latest production version is 2.3.1.  The current beta version is
  144.   2.4.  New patches occur frequently and are added to the archive (next
  145.   question).  At the time of writing the latest patch level was 164.
  146.  
  147.   The next production version will be 2.5 (2.4 will not be released, so
  148.   as to minimise confusion over version numbers).  It is expected that
  149.   no new features will be added before the release.
  150.  
  151.  
  152. 4) Where do I get it?
  153.  
  154.   Bas de Bakker (bas@phys.uva.nl) is in charge of the archive and the
  155.   latest version is available for users east of the Atlantic from:
  156.     carlo.phys.uva.nl (145.18.220.25):/pub/bas/zsh/zsh-2.4beta.tar.gz
  157.   The latest full release is in zsh-2.3.1.tar.gz in the same directory.
  158.   Note that this is in gzip format: you will need GNU gzip (of which there
  159.   is now a production version) from your nearest GNU archive to unpack it.
  160.   There is also a version under RCS control which may be more suitable
  161.   for source hackers.
  162.  
  163.   Rick Ohnemus has a reflector site in the USA:
  164.         ftp.sterling.com (192.124.9.1):/zsh
  165.  
  166.   The 2.3.1 distribution is also available from ftp.uu.net and mirrors
  167.   in the directory pub/shells/zsh.
  168.  
  169.  
  170. 5) How does zsh differ from sh, ksh, csh,...?
  171.  
  172.   As has already been mentioned, zsh is most similar to ksh, while many
  173.   of the additions are to please csh users.
  174.  
  175.   i) ksh:
  176.   Most features of ksh (and hence also of sh) are implemented in zsh;
  177.   problems can arise because the implementation is slightly different.
  178.   Note also that not all ksh's are the same either.  I have based this
  179.   on SunOS 4, which is essentially the 11/16/88 version of ksh.
  180.  
  181.   Various options can be turned on which will increase ksh
  182.   compatibility, though decrease zsh's abilities: see the manual entries
  183.   for IGNORE_BRACES (though brace expansion occurs in some versions of
  184.   ksh), KSH_OPTION_PRINT, NO_BANG_HIST, NO_EQUALS, NO_HUP, NO_RCS,
  185.   NO_SHORT_LOOPS, PROMPT_SUBST, RM_STAR_SILENT, SH_WORD_SPLIT (see
  186.   question 14) and SINGLE_LINE_ZLE.  Note that you can also disable any
  187.   built-in commands which get in your way.  If invoked as `ksh', the
  188.   shell will try and set suitable options.
  189.  
  190.   Differences from ksh which might prove significant for ksh
  191.   programmers, some of which may be interpreted as bugs (there must be
  192.   more) include:
  193.   Syntax:
  194.     Shell word splitting: see question 14.  (This is particularly
  195.       frequently asked about.)
  196.     Arrays are more csh-like than ksh-like:
  197.       subscripts start at 1, not 0; array[0] refers to array[1];
  198.       `$array' refers to the whole array, not $array[0];
  199.       braces are unnecessary: $a[1] == ${a[1]}, etc.
  200.     Coprocesses are established by `coproc'; `|&' behaves like csh.
  201.   Command line substitutions, globbing etc.:
  202.     The $((...)) version of numeric evaluation is not implemented; use $[...].
  203.     Treatment of backslashes within backquotes is different.
  204.     PS1 does not do parameter substitution by default (promptsubst option).
  205.     Globbing does not allow ksh-style `pattern-lists'.
  206.     Unquoted assignments do file expansion after ':'s (intended for PATHs).
  207.   Command execution:
  208.     The PATH is not searched for commands specified at invocation without -c.
  209.     There is no ENV variable (use /etc/zshrc, ~/.zshrc; note also ZDOTDIR).
  210.   Aliases and functions:
  211.     Functions will call themselves recursively: see question 14.
  212.     The order in which aliases and functions are defined is significant
  213.       (function definitions with () expand aliases -- see question 6).
  214.     Aliases and functions cannot be exported.
  215.     There are no tracked aliases: command hashing replaces these.
  216.     The use of aliases for key bindings is replaced by `bindkey'.
  217.     Traps are not local to functions and are not reset automatically
  218.       when called.
  219.   Editing:
  220.     The options emacs, gmacs, privileged, trackall, viraw are not supported.
  221.       (Use bindkey to change the editing behaviour.)
  222.     The `keyword' option does not exist and -k is instead interactivecomments.
  223.     Management of histories in multiple shells is different:
  224.       the history list is not saved and restored after each command.
  225.     \ does not escape editing chars (use ^V).
  226.     Not all ksh bindings are set (e.g. `<ESC>#').
  227.   Built-in commands:
  228.     No built-in commands cause automatic termination of a script on
  229.      failure (e.g., `. file' in a script doesn't cause it to bail out
  230.      if `file' doesn't exist).
  231.     Some built-ins (true, false, r, ...) were aliases in ksh.
  232.     [ ] is a shell built-in, rather than a call to /bin/test.
  233.       (but you can disable the built-in).  It is also a bit
  234.       over-enthusiastic about recognising -o's and -a's.
  235.     There is no built-in command newgrp: use a shell function.
  236.     `jobs' has no `-n' flag.
  237.     In `let "i = foo"', foo is evaluated as a number, not an expression
  238.       (although in `let "i = $foo"' it is treated as an expression).
  239.   Other idiosyncracies:
  240.     `select' always redisplays the list of selections on each loop.
  241.  
  242.   ii) csh:
  243.  
  244.   Although certain features aim to ease the withdrawal symptoms of csh
  245.   (ab)users, the syntax is in general rather different and you should
  246.   certainly not try to run scripts without modification.  The c2z script
  247.   is provided with the source (in scripts/c2z) to help convert .cshrc
  248.   and .login files; see also the next question concerning aliases,
  249.   particularly those with arguments.
  250.  
  251.   Csh-compatibility additions include:
  252.     Logout, rehash, source, (un)limit built-in commands.
  253.     *rc file for interactive shells.
  254.     Directory stacks.
  255.     Cshjunkie*, ignoreeof options.
  256.     The nonomatch option.
  257.     >&, |& etc. redirection.
  258.     foreach ... loops; alternate syntax for other loops.
  259.     $PROMPT as well as $PS1, $status as well as $?, $#argv as well as $#, ....
  260.     Escape sequences via % for prompts.
  261.     Special array variables $PATH etc. are colon-separated, $path are arrays.
  262.     !-type history (which may be turned off via `setopt nobanghist').
  263.     Arrays have csh-like features (see i)).
  264.  
  265.   iii) tcsh:
  266.  
  267.   Certain features have been borrowed from tcsh, including $watch,
  268.   run-help, $savehist, $histlit, periodic commands etc., extended
  269.   prompts, sched and which/where built-ins.  Programmable completion was
  270.   inspired by, but is entirely different to, tcsh's `complete'. (There
  271.   is a perl script called lete2ctl in the scripts directory of the
  272.   source distribution to convert `complete' to `compctl' statements.)
  273.   This list is not definitive: some features have gone in the other
  274.   direction.
  275.  
  276.   If you're missing the editor function run-fg-editor, try something
  277.   with bindkey -s (which binds a string to a keystroke), e.g.
  278.     bindkey -s '^z' '\eqfg %$EDITOR:t\n'
  279.   which pushes the current line onto the stack and tries to bring a job
  280.   with the basename of your editor into the foreground.  With a bit
  281.   of playing around you can implement run-fg-anything.
  282.  
  283.  
  284. 6) Why do my csh aliases not work?  (Plus other alias pitfalls.)
  285.  
  286.   First of all, check you are using the syntax
  287.     alias newcmd='list of commands'
  288.   and not
  289.     alias newcmd 'list of commands'
  290.   which won't work. (It tells you if `newcmd' and `list of commands' are
  291.   already defined as aliases.)
  292.  
  293.   Otherwise, your aliases probably contain references to the command
  294.   line of the form `\!*', etc.  Zsh does not handle this behaviour as it
  295.   has shell functions which provide a way of solving this problem more
  296.   consistent with other forms of argument handling.  For example, the
  297.   csh alias
  298.     alias cd 'cd \!*; echo $cwd'
  299.   can be replaced by the zsh function,
  300.     cd() { builtin cd $*; echo $PWD; }
  301.   (the `builtin' tells zsh to use its own `cd', avoiding an infinite loop)
  302.   or, perhaps better,
  303.     cd() { builtin cd $*; print -D $PWD; }
  304.   (which converts your home directory to a ~).  In fact, this problem is
  305.   better solved by defining the special function chpwd() (see the manual).
  306.   Note also that the `;' at the end of the function is optional in zsh,
  307.   but not in ksh or sh (for sh's where it exists).
  308.  
  309.   Here is Bart Schaefer's guide to converting csh aliases for zsh.
  310.  
  311.     1.  If the csh alias references "parameters" (\!:1 \!* etc.),
  312.         then in zsh you need a function (referencing $1 $* etc.).
  313.         Otherwise, you can use a zsh alias.
  314.  
  315.     2.  If you use a zsh function, you need to refer _at_least_ to
  316.         $* in the body (inside the { }).  Parameters don't magically
  317.         appear inside the { } the way they get appended to an alias.
  318.     
  319.     3.  If the csh alias references its own name (alias rm "rm -i"),
  320.         then in a zsh function you need the "command" keyword
  321.         (function rm() { command rm -i $* }), but in a zsh alias
  322.         you don't (alias rm="rm -i").
  323.  
  324.     4.  If you have aliases that refer to each other (alias ls "ls -C";
  325.         alias lf "ls -F" ==> lf == ls -C -F) then you must either:
  326.         a.  convert all of them to zsh functions; or
  327.         b.  after converting, be sure your .zshrc defines all of your
  328.             aliases before it defines any of your functions.
  329.  
  330.     Those first four are all you really need, but here are four more for
  331.     heavy csh alias junkies:
  332.  
  333.     5.  Mapping from csh alias "parameter referencing" into zsh function
  334.         (assuming shwordsplit is NOT set in zsh):
  335.              csh                   zsh
  336.             =====               ==========
  337.             \!*                 $*              (or $argv)
  338.             \!^                 $1              (or $argv[1])
  339.             \!:1                $1
  340.             \!:2                $2              (or $argv[2], etc.)
  341.             \!$                 $*[$#]          (or $argv[$#], or $*[-1])
  342.             \!:1-4              $*[1,4]
  343.             \!:1-               $*[1,$#-1]      (or $*[1,-2])
  344.             \!^-                $*[1,$#-1]
  345.             \!*:q               "$@"            ($*:q doesn't work (yet))
  346.             \!*:x               $=*             ($*:x doesn't work (yet))
  347.  
  348.     6.  Remember that it is NOT a syntax error in a zsh function to
  349.         refer to a position ($1, $2, etc.) greater than the number of
  350.         parameters. (E.g., in a csh alias, a reference to \!:5 will
  351.         cause an error if 4 or fewer arguments are given; in a zsh
  352.     function, $5 is the empty string if there are 4 or fewer
  353.     parameters.)
  354.  
  355.     7.  To begin a zsh alias with a - (dash, hyphen) character, use
  356.         "alias --":
  357.                  csh                            zsh
  358.             ===============             ==================
  359.             alias - "fg %-"             alias -- -="fg %-"
  360.  
  361.     8.  Stay away from "alias -g" in zsh until you REALLY know what
  362.         you're doing.
  363.  
  364.   There is one other serious problem with aliases: consider
  365.         alias l='/bin/ls -F'
  366.         l() { /bin/ls -la $* | more }
  367.   `l' in the function definition is in command position and is expanded
  368.   as an alias, defining `/bin/ls' and `-F' as functions which call
  369.   `/bin/ls', which gets a bit recursive.  This can be avoided if you use
  370.   `function' to define a function, which doesn't expand aliases.  It is
  371.   possible to argue for extra warnings somewhere in this mess.  If you
  372.   define `function' as an alias you deserve what you get.
  373.  
  374.  
  375. 7) How do I get the meta key to work on my xterm?
  376.  
  377.   As stated in the manual, zsh needs to be told about the meta key by
  378.   using `bindkey -me' or `bindkey -mv' in your .zshrc or on the command
  379.   line.  You probably also need to tell the terminal driver to allow the
  380.   `meta' bit of the character through; `stty pass8' is the usual
  381.   incantation.  Sample .zshrc entry:
  382.     [[ $TERM = "xterm" ]] && stty pass8 && bindkey -me
  383.   or, on SYSVR4-ish systems without pass8,
  384.     [[ $TERM = "xterm" ]] && stty -parenb -istrip cs8 && bindkey -me
  385.   (disable parity detection, don't strip high bit, use 8-bit characters).
  386.   Make sure this comes *before* any bindkey entries in your .zshrc which
  387.   redefine keys normally defined in the emacs/vi keymap.
  388.  
  389.  
  390. 8) Why does my terminal act funny in way x?
  391.  
  392.   If you are using an OpenWindows cmdtool as your terminal, any
  393.   escape sequences (such as those produced by cursor keys) will be
  394.   swallowed up and never reach zsh.  Either use shelltool or avoid
  395.   commands with escape sequences.  You can also disable scrolling from
  396.   the cmdtool pane menu (which effectively turns it into a shelltool).
  397.   If you still want scrolling, try using an xterm with the scrollbar
  398.   activated.
  399.  
  400.   If that's not the problem, and you are using stty to change some tty
  401.   settings, make sure you haven't asked zsh to freeze the tty settings:
  402.   type
  403.     ttyctl -u
  404.   before any stty commands you use.
  405.  
  406.   If _that's_ not the problem, and you are having difficulties with
  407.   external commands (not part of zsh), and you think some terminal
  408.   setting is wrong (e.g. ^V is getting interpreted as `literal next
  409.   character' when you don't want it to be), try
  410.     ttyctl -u
  411.     STTY='lnext "^-"' commandname
  412.   (in this example), or just export STTY for all commands to see.  Note
  413.   that zsh doesn't reset the terminal completely afterwards: just the
  414.   modes it uses itself and a number of special processing characters
  415.   (see the stty(1) manual page).
  416.  
  417.  
  418. 9) Why does `$var' where var="foo bar" not do what I expect?
  419.  
  420.   In most Bourne-shell derivatives, multi-word variables such as
  421.     var="foo bar"
  422.   are split into words when passed to a command or used in a `for foo in
  423.   $var' loop.  By default, zsh does not have that behaviour: the
  424.   variable remains intact.  (This is not a bug!  See below.)  An option
  425.   (shwordsplit) exists to provide compatibility.
  426.   
  427.   For example, defining the function args to show the number of its
  428.   arguments:
  429.     args() { echo $#; }
  430.   and with our definition of vble,
  431.     args $vble
  432.   produces the output `1'.  After
  433.     setopt shwordsplit
  434.   the same function produces the output `2', as with sh and ksh.
  435.   
  436.   Unless you need strict sh/ksh compatibility, you should ask yourself
  437.   whether you really want this behaviour, as it can produce unexpected
  438.   effects for variables with entirely innocuous embedded spaces.  The
  439.   natural way to produce word-splitting behaviour in zsh is via arrays.
  440.   For example,
  441.     set -A array one two three twenty
  442.   (or
  443.         array=(one two three twenty)
  444.   if you prefer), followed by
  445.     args $array
  446.   produces the output `4', regardless of the setting of shwordsplit.
  447.   Arrays are also much more versatile than single strings.
  448.  
  449.   Note also the "$@" method of word splitting is always available in zsh
  450.   functions and scripts (though strictly this does array splitting, not
  451.   word splitting), also the substitution ${=foo} to toggle word
  452.   splitting on variable `foo'.
  453.  
  454.  
  455. 10) My PATH, (MANPATH, ...) sometimes doesn't handle tildes.  What gives?
  456.  
  457.   The code has recently been overhauled, so take a look at the latest
  458.   version of 2.4beta.  This guarantees that no ~user expansion (or
  459.   =command expansion, which takes place at the same time) will happen if
  460.   the tilde is quoted, and also rationalises PATH-type variables by
  461.   expanding all unquoted assignments as if they are colon-separated
  462.   lists (so you may need to add or subtract a few extra quotes, but the
  463.   results are more predictable).  In addition typeset, etc., now should
  464.   behave like ordinary assignments in this respect; previously tildes in
  465.   typeset assignments were unquotable.
  466.  
  467.  
  468. 11) How does base arithmetic work?
  469.  
  470.   The syntax (e.g. using the `let' builtin is)
  471.     let 'foo = [16]ff'
  472.   or equivalently
  473.     (( foo = [16]ff ))
  474.   Then
  475.     echo $foo
  476.   gives the answer `255'.  It is possible to declare variables explicitly
  477.   to be integers, via
  478.     typeset -i foo
  479.   which has a different effect: namely the base used in the first
  480.   assignment (hexadecimal in the example) is subsequently used whenever
  481.   `foo' is displayed (although the internal representation is unchanged).
  482.   To ensure foo is always displayed in decimal, declare it as
  483.     typeset -i 10 foo
  484.   which requests base 10 for output.  You can change the output base of an
  485.   existing variable in this fashion.  Using the `$[ ... ]' method will
  486.   always display in decimal.
  487.  
  488.  
  489. 12) How do I get a newline in my prompt?
  490.  
  491.   You can place a literal newline in quotes, i.e.
  492.     PROMPT="Hi Joe,
  493.     what now?%# "
  494.   If you have the bad taste to set the option cshjunkiequotes, which
  495.   inhibits such behaviour, you will have to bracket this with 
  496.   `unsetopt cshjunkiequotes' and `setopt cshjunkiequotes', or put it in
  497.   your .zshrc before the option is set.
  498.  
  499.  
  500. 13) Why does `bindkey ^a command-name' or 'stty intr ^-' do something funny?
  501.  
  502.   You probably have the extendedglob option set in which case ^ and #
  503.   are metacharacters.  ^a matches any file except one called a, so the
  504.   line is interpreted as bindkey followed by a list of files.  Quote the
  505.   ^ with a backslash or put quotation marks around ^a.
  506.  
  507.  
  508. 14) How do I execute command `foo' within function `foo'?
  509.  
  510.   The command `command foo' does just that.  You don't need this with
  511.   aliases, but you do with functions.  Note that error messages like
  512.         zsh: job table full or recursion limit exceeded
  513.   are a good sign that you tried calling `foo' in function `foo' without
  514.   using `command'.  (In ksh, functions were never called recursively.)
  515.  
  516.  
  517. 15) I can't get zsh to work with SGI's `userenv'.
  518.  
  519.   It seems the Silicon Graphics `userenv' command interacts weirdly with
  520.   the line editor (zsh is not unique in this respect).  Add this line to
  521.   the top of your .zshenv file:
  522.         if [[ "${ENVONLY:-0}" -eq 1 ]]; then unsetopt zle; fi
  523.   --- which will turn the line editor off if it sees a `userenv' coming.
  524.   Don't turn zle back on with setopt until [[ $ENVONLY -ne 1 ]].
  525.  
  526.  
  527. 16) Why do history substitutions with single bangs do something funny?
  528.  
  529.   If you have a command like "echo !-2:$ !$", the first history
  530.   substitution then sets a default to which later history substitutions
  531.   with single unqualified bangs refer, so that !$ becomes equivalent to
  532.   !-2:$.  The option CSH_JUNKIE_HISTORY makes all single bangs refer
  533.   to the last command.
  534.  
  535.  
  536. 17) Why does zsh kill off all my background jobs when I logout?
  537.  
  538.   Simple answer: you haven't asked it not to.  Zsh (unlike [t]csh) gives
  539.   you the option of having background jobs killed or not: the `nohup'
  540.   option exists if you don't want them killed.  Note that you can always
  541.   run programs with `nohup' in front of the pipeline whether or not the
  542.   option is set, which will prevent that job from being killed on
  543.   logout.  (Nohup is actually an external command.)
  544.  
  545.   The `disown' builtin is very useful in this respect: if zsh informs
  546.   you that you have background jobs when you try to logout, you can
  547.   `disown' all the ones you don't want killed when you exit.  This is
  548.   also a good way of making jobs you don't need the shell to know about
  549.   (such as commands which create new windows) invisible to the shell.
  550.  
  551.  
  552. 18) I don't have root access: how do I make zsh my login shell?
  553.  
  554.   Unfortunately, on many machines you can't use `chsh' to change your
  555.   shell unless the name of the shell is contained in /etc/shells, so if
  556.   you have your own copy of zsh you need some sleight-of-hand to use it
  557.   when you log on.  (Simply typing `zsh' is not really a solution since
  558.   you still have your original login shell waiting for when you exit.)
  559.   
  560.   The basic idea is to use `exec <zsh-path>' to replace the current
  561.   shell with zsh.  Often you can do this in a login file such as
  562.   .profile (if your shell is sh or ksh) or .login (if it's csh).  Make
  563.   sure you have some way of altering the file (e.g. via FTP) before you
  564.   try this as `exec' is often rather unforgiving.
  565.  
  566.   In .profile, try something like
  567.     [ -f $HOME/bin/zsh ] && exec $HOME/bin/zsh -l
  568.   and in .login, try something like
  569.     if ( -f ~/bin/zsh ) exec ~/bin/zsh -l
  570.   (in each case the -l tells zsh it is a login shell).  
  571.  
  572.   It's not a good idea to put this (even without the -l) into .cshrc, at
  573.   least without some tests on what the csh is supposed to be doing, as
  574.   that will cause _every_ instance of csh to turn into a zsh and will
  575.   cause csh scripts (yes, unfortunately some people write these) which
  576.   do not call `csh -f' to fail.  If you want to tell xterm to run zsh,
  577.   change the SHELL environment variable to the full path of zsh at the
  578.   same time as you exec zsh.  If you have to exec zsh from your .cshrc,
  579.   a minimum safety check is `if ($?prompt) ...'.
  580.  
  581.   If you like your login shell to appear in the process list as '-zsh',
  582.   you can link zsh to -zsh (e.g. by `ln -s ~/bin/zsh ~/bin/-zsh') and
  583.   change the exec to `exec -zsh'.  (Make sure -zsh is in your path.)
  584.   This has the same effect as the `-l' option.
  585.  
  586.   Footnote: if you DO have root access, make sure zsh goes in
  587.   /etc/shells on all appropriate machines, including NIS clients, or you
  588.   may have problems with FTP to that machine.
  589.  
  590.  
  591. 19) What bugs are currently known and unfixed?
  592.  
  593.   Here are some of the more well-known ones, very roughly in decreasing
  594.   order of significance.  A fuller bug list is now maintained by Carlos
  595.   Carvalho <carlos@snfep1.if.usp.br>.  Many of these can also be counted
  596.   against differences from ksh in question 5); note that this applies to
  597.   the latest beta version and that simple bugs are often fixed quite
  598.   quickly.
  599.  
  600.   (?? Weird command hashing problems e.g. with command completion,
  601.     only experienced by some users ??)
  602.   Lines which spill over the right margin cannot be cut/pasted properly
  603.     (not necessarily a bug, but highly annoying).
  604.   Pipelines ending in a while/until/for loop are uninterruptible.
  605.   Certain built-ins won't allow the `VAR=value command ...' assignment;
  606.     the ones that do don't unset VAR after use (may not really be a bug).
  607.     (N.B.: `exec foo=bar command' is a workaround for exec.)
  608.   The `histlit' option adds newlines to lines in the history
  609.     (and is broken in several other ways, e.g. !:x word selection).
  610.   `time' is ignored with builtins and can't be used with {...} or (...);
  611.     in shells with no job control the command name is blank.
  612.   $_ returns the last unexpanded word from the previous line (not command).
  613.   The :q modifier doesn't split words and -q and -x don't work for variables.
  614.   In vi mode, `u' can go past the original modification point.
  615.   Autocd won't use globbed filenames.
  616.   Linked directories can sometimes confuse zsh's idea of its cwd.
  617.   Input processing of e.g. ^V is doing something weird in Solaris 2.
  618.   Still problems under SCO Unix (a patch exists but hasn't been merged yet).
  619.  
  620.   Former bugs recently fixed (in archive now or soon):
  621.     `return' in a shell script should have acted as `exit'.
  622.     "$@" always indicated at least one argument.
  623.     ${1+foo} always returned `foo' even if $1 was not set.
  624.     Attempts to trap untrappable signals produced an incorrect message.
  625.     Autoloaded functions with malformed [[...]] constructs dumped core.
  626.  
  627.  
  628. 20) Where do I report bugs, get more info / who's working on zsh?
  629.  
  630.   The shell is being maintained by various (entirely self-appointed)
  631.   subscribers to the mailing list,
  632.     zsh-list@imd.sterling.com so any suggestions, complaints,
  633.   questions and matters for discussion should be sent there.  If you
  634.   want someone to mail you directly, say so.  Most patches to zsh appear
  635.   there first.
  636.   
  637.   A lower-volume list,
  638.     zsh-announce@imd.sterling.com
  639.   exists for announcements of new features and proposed changes
  640.   requiring some decisions.
  641.  
  642.   Both lists are handled by an automated server.  The instructions for
  643.   zsh-announce are the same as for zsh-list: just change zsh-list to
  644.   zsh-announce everywhere in the following.
  645.  
  646.   To join zsh-list, send email to
  647.     Majordomo@imd.sterling.com
  648.   containing
  649.     subscribe zsh-list <optional-address>
  650.   where <optional-address> can be blank if you want to subscribe from
  651.   your current email address.  Send the message `help' to the same
  652.   address for help on the list server; `unsubscribe zsh-list' also
  653.   works. (Don't send this to the list!) The list manager, Rick Ohnemus,
  654.   can be reached at
  655.     owner-zsh-list@imd.sterling.com
  656.   (or `rick' at the same adress).
  657.  
  658.   The list (everything since May 1992) is archived in
  659.     ftp.sterling.com:zsh/zsh-list/YY-MM
  660.   where YY-MM are the year and month in digits.
  661.  
  662.  
  663. 21) What's on the wish-list?
  664.  
  665.   The shell is getting rather large and any simplifications would be
  666.     appreciated.
  667.   Option for glob qualifiers to follow perl syntax.
  668.   Option to quote !-history lexically via '' but not ""..
  669.   Binding of shell functions (or commands?) to key strokes --
  670.     requires some way of accessing the editing buffer from functions
  671.     and probably of executing zle functions as a command.
  672.   Ksh/sh compatibility could be improved if required.
  673.   The introduction to zsh (intro.*) could do with an update to reflect
  674.     extended completion (in particular) and other recent additions.
  675.  
  676.  
  677. Acknowledgments:
  678.  
  679. Thanks to zsh-list, in particular Bart Schaefer, for suggestions
  680. regarding this document; thanks to Jim Mattson and more recently Bas de
  681. Bakker for their hard work as archivists, and to Peter Gray for
  682. maintaining the mailing list, without which zsh might easily have died,
  683. and to the latest list maintainer, Rick Ohnemus.  The world is eternally
  684. in the debt of Paul Falstad for inventing zsh in the first place.
  685.